using UnityEngine;
using System.Collections;


//S'occupe du choix des éléments à afficher en fonction de l'état du jeu.
public class GUIManager : MonoBehaviour
{
    public delegate void DrawGUI();
    public DrawGUI currentGUI;

    public GameManager gameManager;
    public GameMenus gameMenus;
    public Networking networkManager;
	public Hud hud;
    public GUISkin skin;

    //ajouter une pile de fonctions ?

    public void Update()
    {
        if (networkManager.showErrorWindow)
        {
            currentGUI = networkManager.DrawGUI;
        }
        else
        {
            //display main menu
            if (gameManager.gameStatus == GameStatus.Start)
            {
                //Screen.lockCursor = false;
                currentGUI = gameMenus.DrawGUI;
            }

            if (gameManager.gameStatus == GameStatus.Lobby)
            {
                currentGUI = gameMenus.DrawGUI;
            }
			if (gameManager.gameStatus == GameStatus.Game)
            {
				currentGUI = gameMenus.DrawGUI;
            }
        }
    }

    public void ClearGUI()
    {

    }

    public void OnGUI()
    {
        GUI.skin = skin;
        currentGUI();
    }
}
